<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>

<%@include file="../include/base.jsp" %>
<!DOCTYPE HTML>
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">	
	<title>CRM-task</title>
	<%@ include file="../include/head.jsp" %>
	<title></title>
</head>
<body class="crm">
	
	<jsp:include page="../include/top.jsp">
		<jsp:param value="task" name="tag"/>
	</jsp:include>
	
	<div class="container-fluid">
		<div class="row-fluid">
			<div class="span8">
				<div class="well screen">
					<div class="page-header header">

						
						<div class="right-links">
							<a href="${basePath }/task/task.action">待办任务</a> |
							<a href="${basePath }/task/taskcomplete.action" class="current">已完成的任务</a>
						</div>
						已完成的任务 

					</div>
					
					<div class="main" id="main">
						

		<div class="tasks">
				<legend>所有的任务</legend>
				<c:if test="${fn:length(taskList) == 0}">
					<div class="alert alert-info">
					<h4>没有已完成的任务！</h4>
					可能没有完成任何任务， 或者已删除了所有已经完成的任务。
					</div>
				</c:if>
				<c:forEach items="${taskList }" var="task">
					<div id="task_818250" style="margin:5px;padding:0 5px;position: relative;" class="hover_container">
						<a href="javascript:;" class="icon icon-trash" id="${task.id }" onclick="deleteTask(this)" title="删除"></a>
			
						
						<blockquote>
							<span style="background:#${task.tasktype.color};border-radius: 3px 3px 3px 3px;padding:1px 5px;color:#fff">${task.tasktype.type }</span>
						  <span>${task.title }</span>
						  <c:if test="${task.deal  != null}">
						 	( <i class="icon-dollar"></i>
						 	<a href="${basePath }/deal/show.action?id=${task.deal.id}">${task.deal.title }</a> )
						 </c:if>
						 <c:if test="${task.contact  != null}">
						 	( <i class="icon-person"></i>
						 	<a href="${basePath }/contact/show.action?id=${task.contact.id}">${task.contact.name }</a> )
						 </c:if>
						  <small>【${task.start } - ${task.end}】</small>
						</blockquote>
					
					</div>
				</c:forEach>
				
				<script type="text/javascript" charset="utf-8">
					function deleteTask(obj) {
							id = $(obj).attr("id");
							$.get("delete.action",{"task.id":id},function(){
								$(obj).parent().fadeOut();
							});
						}
				</script>
				
		</div>

					</div>
				</div>
			</div>
			<div class="span4 sidebar">
					

			</div>
		</div>
	</div>
</body>
</html>
